<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>IT 技术职位列表</title>
		<style>
			body {
				font-family: Arial, sans-serif;
				margin: 0;
				padding: 0;
				display: flex;
				flex-direction: column;
				align-items: center;
			}

			header {
				width: 100%;
				padding: 20px;
				background-color: #f1f1f1;
				text-align: center;
			}

			input[type="text"] {
				padding: 10px;
				width: 80%;
				border: 1px solid #ccc;
				border-radius: 4px;
			}

			main {
				width: 80%;
				max-width: 1200px;
				display: flex;
				flex-direction: column;
				align-items: center;
				margin-top: 20px;
			}

			.category {
				width: 100%;
				border-bottom: 1px solid #ccc;
				padding: 10px 0;
			}

			.category h4 {
				cursor: pointer;
				background-color: #f1f1f1;
				padding: 10px;
				margin: 0;
				border-radius: 4px;
			}

			.category .text {
				display: none;
				padding: 10px 0;
			}

			.category .text a {
				display: block;
				padding: 8px 16px;
				text-decoration: none;
				color: #000;
				background-color: #ddd;
				margin: 5px 0;
				border-radius: 4px;
			}

			.category .text a:hover {
				background-color: #bbb;
				color: white;
			}

			#content {
				width: 100%;
				margin-top: 20px;
				padding: 20px;
				border: 1px solid #ccc;
				min-height: 200px;
			}

			#images {
				width: 100%;
				margin-top: 20px;
				display: flex;
				justify-content: center;
			}

			#images img {
				max-width: 100%;
				height: auto;
				margin: 10px;
			}
		</style>
	</head>
	<meta charset="utf-8">
	<title>IT 技术职位列表</title>
	<style>
		body {
			font-family: Arial, sans-serif;
			margin: 0;
			padding: 0;
			display: flex;
			flex-direction: column;
			align-items: center;
		}

		header {
			width: 100%;
			padding: 20px;
			background-color: #f1f1f1;
			text-align: center;
		}

		input[type="text"] {
			padding: 10px;
			width: 80%;
			border: 1px solid #ccc;
			border-radius: 4px;
		}

		main {
			width: 80%;
			max-width: 1200px;
			display: flex;
			flex-direction: column;
			align-items: center;
			margin-top: 20px;
		}

		.category {
			width: 100%;
			border-bottom: 1px solid #ccc;
			padding: 10px 0;
		}

		.category h4 {
			cursor: pointer;
			background-color: #f1f1f1;
			padding: 10px;
			margin: 0;
			border-radius: 4px;
		}

		.category .text {
			display: none;
			padding: 10px 0;
		}

		.category .text a {
			display: block;
			padding: 8px 16px;
			text-decoration: none;
			color: #000;
			background-color: #ddd;
			margin: 5px 0;
			border-radius: 4px;
		}

		.category .text a:hover {
			background-color: #bbb;
			color: white;
		}

		#content {
			width: 100%;
			margin-top: 20px;
			padding: 20px;
			border: 1px solid #ccc;
			min-height: 200px;
		}

		#images {
			width: 100%;
			margin-top: 20px;
			display: flex;
			justify-content: center;
		}

		#images img {
			max-width: 100%;
			height: auto;
			margin: 10px;
		}
	</style>
	</head>
	<body>
		<header>
			<input type="text" id="searchInput" placeholder="搜索职位...">
		</header>
		<main>
			<div class="category">
				<h4 onclick="toggleCategory(this)">后端开发</h4>
				<div class="text">
					<a ka="search_100101" href="/c100010000-p100102/">Java</a>
					<a ka="search_100102" href="/c100010000-p100102/">C/C++</a>
					<a ka="search_100103" href="/c100010000-p100103/">PHP</a>
					<a ka="search_100109" href="/c100010000-p100109/">Python</a>
					<a ka="search_100106" href="/c100010000-p100106/">C#</a>
					<a ka="search_100107" href="/c100010000-p100107/">.NET</a>
					<a ka="search_100116" href="/c100010000-p100116/">Golang</a>
					<a ka="search_100114" href="/c100010000-p100114/">Node.js</a>
					<a ka="search_100108" href="/c100010000-p100108/">Hadoop</a>
					<a ka="search_100121" href="/c100010000-p100121/">语音/视频/图形开发</a>
					<a ka="search_100124" href="/c100010000-p100124/">GIS工程师</a>
					<a ka="search_100125" href="/c100010000-p100125/">区块链工程师</a>
					<a ka="search_100123" href="/c100010000-p100123/">全栈工程师</a>
					<a ka="search_100199" href="/c100010000-p100199/">其他后端开发</a>
				</div>
			</div>
			<div class="category">
				<h4 onclick="toggleCategory(this)">前端/移动开发</h4>
				<div class="text">
					<a ka="search_100901" href="/c100010000-p100901/">前端开发工程师</a>
					<a ka="search_100202" href="/c100010000-p100202/">Android</a>
					<a ka="search_100203" href="/c100010000-p100203/">iOS</a>
					<a ka="search_100209" href="/c100010000-p100209/">U3D</a>
					<a ka="search_100211" href="/c100010000-p100211/">UE4</a>
					<a ka="search_100210" href="/c100010000-p100210/">Cocos</a>
					<a ka="search_100212" href="/c100010000-p100212/">技术美术</a>
					<a ka="search_100208" href="/c100010000-p100208/">JavaScript</a>
					<a ka="search_100213" href="/c100010000-p100213/">鸿蒙开发工程师</a>
				</div>
			</div>
			<div class="category">
				<h4 onclick="toggleCategory(this)">测试</h4>
				<div class="text">
					<a ka="search_100301" href="/c100010000-p100301/">测试工程师</a>
					<a ka="search_100309" href="/c100010000-p100309/">软件测试</a>
					<a ka="search_100302" href="/c100010000-p100302/">自动化测试</a>
					<a ka="search_100303" href="/c100010000-p100303/">功能测试</a>
					<a ka="search_100305" href="/c100010000-p100305/">测试开发</a>
					<a ka="search_100308" href="/c100010000-p100308/">硬件测试</a>
					<a ka="search_100307" href="/c100010000-p100307/">游戏测试</a>
					<a ka="search_100304" href="/c100010000-p100304/">性能测试</a>
					<a ka="search_100310" href="/c100010000-p100310/">渗透测试</a>
					<a ka="search_100703" href="/c100010000-p100703/">测试经理</a>
				</div>
			</div>
			<div class="category">
				<h4 onclick="toggleCategory(this)">运维/技术支持</h4>
				<div class="text">
					<a ka="search_100401" href="/c100010000-p100401/">运维工程师</a>
					<a ka="search_100405" href="/c100010000-p100405/">IT技术支持</a>
					<a ka="search_100403" href="/c100010000-p100403/">网络工程师</a>
					<a ka="search_100407" href="/c100010000-p100407/">网络安全</a>
					<a ka="search_100404" href="/c100010000-p100404/">系统工程师</a>
					<a ka="search_100402" href="/c100010000-p100402/">运维开发工程师</a>
					<a ka="search_100406" href="/c100010000-p100406/">系统管理员</a>
					<a ka="search_100409" href="/c100010000-p100409/">DBA</a>
					<a ka="search_290166" href="/c100010000-p290166/">电脑/打印机维修</a>
					<a ka="search_100408" href="/c100010000-p100408/">系统安全</a>
					<a ka="search_100410" href="/c100010000-p100410/">技术文档工程师</a>
				</div>
			</div>
			<div class="category">
				<h4 onclick="toggleCategory(this)">人工智能</h4>
				<div class="text">
					<a ka="search_101306" href="/c100010000-p101306/">图像算法</a>
					<a ka="search_100117" href="/c100010000-p100117/">自然语言处理算法</a>
					<a ka="search_101310" href="/c100010000-p101310/">大模型算法</a>
					<a ka="search_100104" href="/c100010000-p100104/">数据挖掘</a>
					<a ka="search_101311" href="/c100010000-p101311/">规控算法</a>
					<a ka="search_101312" href="/c100010000-p101312/">SLAM算法</a>
					<a ka="search_100118" href="/c100010000-p100118/">推荐算法</a>
					<a ka="search_100115" href="/c100010000-p100115/">搜索算法</a>
					<a ka="search_101305" href="/c100010000-p101305/">语音算法</a>
					<a ka="search_101309" href="/c100010000-p101309/">风控算法</a>
					<a ka="search_101307" href="/c100010000-p101307/">算法研究员</a>
					<a ka="search_100120" href="/c100010000-p100120/">算法工程师</a>
					<a ka="search_101301" href="/c100010000-p101301/">机器学习</a>
					<a ka="search_101302" href="/c100010000-p101302/">深度学习</a>
					<a ka="search_101308" href="/c100010000-p101308/">自动驾驶系统工程师</a>
					<a ka="search_130121" href="/c100010000-p130121/">数据标注/AI训练师</a>
				</div>
			</div>
			<div class="category">
				<h4 onclick="toggleCategory(this)">销售技术支持</h4>
				<div class="text">
					<a ka="search_101201" href="/c100010000-p101201/">售前技术支持</a>
					<a ka="search_101202" href="/c100010000-p101202/">售后技术支持</a>
					<a ka="search_101299" href="/c100010000-p101299/">销售技术支持</a>
					<a ka="search_160303" href="/c100010000-p160303/">客户成功</a>
				</div>
			</div>
			<div class="category">
				<h4 onclick="toggleCategory(this)">数据</h4>
				<div class="text">
					<a ka="search_100511" href="/c100010000-p100511/">数据分析师</a>
					<a ka="search_100508" href="/c100010000-p100508/">数据开发</a>
					<a ka="search_100507" href="/c100010000-p100507/">数据仓库</a>
					<a ka="search_100506" href="/c100010000-p100506/">ETL工程师</a>
					<a ka="search_100104" href="/c100010000-p100104/">数据挖掘</a>
					<a ka="search_100512" href="/c100010000-p100512/">数据架构师</a>
					<a ka="search_100514" href="/c100010000-p100514/">爬虫工程师</a>
					<a ka="search_100122" href="/c100010000-p100122/">数据采集</a>
					<a ka="search_100515" href="/c100010000-p100515/">数据治理</a>
				</div>
			</div>
			<div class="category">
				<h4 onclick="toggleCategory(this)">技术项目管理</h4>
				<div class="text">
					<a ka="search_100601" href="/c100010000-p100601/">项目经理/主管</a>
					<a ka="search_100603" href="/c100010000-p100603/">项目助理</a>
					<a ka="search_100604" href="/c100010000-p100604/">项目专员</a>
					<a ka="search_100606" href="/c100010000-p100606/">实施工程师</a>
					<a ka="search_100605" href="/c100010000-p100605/">实施顾问</a>
					<a ka="search_100607" href="/c100010000-p100607/">需求分析工程师</a>
					<a ka="search_100817" href="/c100010000-p100817/">硬件项目经理</a>
				</div>
			</div>
			<div class="category">
				<h4 onclick="toggleCategory(this)">高端技术职位</h4>
				<div class="text">
					<a ka="search_100701" href="/c100010000-p100701/">技术经理</a>
					<a ka="search_100704" href="/c100010000-p100704/">架构师</a>
					<a ka="search_100702" href="/c100010000-p100702/">技术总监</a>
					<a ka="search_100705" href="/c100010000-p100705/">CTO/CIO</a>
					<a ka="search_100707" href="/c100010000-p100707/">技术合伙人</a>
					<a ka="search_100706" href="/c100010000-p100706/">运维总监</a>
				</div>
			</div>
			<div class="category">
				<!-- 其他职位链接 -->
			</div>
			</div>
			<!-- 其他职位类别 -->
		</main>

		<div id="content">
			<iframe id="contentFrame" src="./ginpage/c100010000_p100101.html" width="100%" height="600px" frameborder="0"></iframe>
			<!-- 加载的内容将在这里显示 -->
		</div>
		<div id="images">
			<!-- 插入图片的地方 -->
			<img src="./Java.png" alt="Image 1">
			<img src="./运维工程师.png" alt="Image 1">
		</div>
		<div id="comments">
			<!-- 评论内容将在这里显示 -->
		</div>
		<form id="commentForm">
			<textarea id="commentText" placeholder="输入评论..." rows="4" cols="50"></textarea>
			<button type="button" onclick="submitComment()">提交评论</button>
		</form>
		<script>
			function toggleCategory(element) {
				const textDiv = element.nextElementSibling;
				if (textDiv.style.display === "block") {
					textDiv.style.display = "none";
				} else {
					textDiv.style.display = "block";
				}
			}

			function loadContent(url) {
				const contentDiv = document.getElementById('content');
				contentDiv.innerHTML = 'Loading...';

				fetch(url)
					.then(response => response.text())
					.then(data => {
						contentDiv.innerHTML = data;
					})
					.catch(error => {
						contentDiv.innerHTML = 'Error loading content: ' + error.message;
					});
			}

			document.addEventListener('DOMContentLoaded', function() {
				const links = document.querySelectorAll('.text a');
				links.forEach(link => {
					link.addEventListener('click', function(event) {
						event.preventDefault();
						const url = this.getAttribute('data-url');
						loadContent(url);
					});
				});
			});

			function search() {
				const query = document.getElementById('searchInput').value;
				fetch(`/search?query=${query}`)
					.then(response => response.json())
					.then(data => {
						const contentDiv = document.getElementById('content');
						contentDiv.innerHTML = '';
						if (data.industries.length > 0) {
							contentDiv.innerHTML += '<h2>行业</h2>';
							data.industries.forEach(industry => {
								contentDiv.innerHTML += `<p>${industry.industry}</p>`;
							});
						}
						if (data.directions.length > 0) {
							contentDiv.innerHTML += '<h2>方向</h2>';
							data.directions.forEach(direction => {
								contentDiv.innerHTML += `<p>${direction.direction}</p>`;
							});
						}
						if (data.professions.length > 0) {
							contentDiv.innerHTML += '<h2>职位</h2>';
							data.professions.forEach(profession => {
								contentDiv.innerHTML += `<p>${profession.profession}</p>`;
							});
						}
					})
					.catch(error => {
						console.error('Error searching:', error);
					});
			}

			function submitComment() {
				const commentText = document.getElementById('commentText').value;
				if (commentText.trim() === '') {
					alert('评论内容不能为空');
					return;
				}

				fetch('http://127.0.0.1:8848/user/v1/comment', {
						method: 'POST',
						headers: {
							'Content-Type': 'application/json',
							'Authorization': 'Bearer ' + localStorage.getItem('token') // 假设你已经存储了 token
						},
						body: JSON.stringify({
							content: commentText
						})
					})
					.then(response => {
						if (!response.ok) {
							throw new Error('Network response was not ok ' + response.statusText);
						}
						return response.json();
					})
					.then(data => {
						const commentsDiv = document.getElementById('comments');
						commentsDiv.innerHTML += `<p>${data}</p>`;
						document.getElementById('commentText').value = '';
					})
					.catch(error => {
						console.error('Error submitting comment:', error);
					});
			}
		</script>
	</body>
</html>